import { post } from '@feidao/web/request';
import { file_url } from '../atom-web/config';

export default async function upload(spaceid: string, file_str: string[]) {
	const url = file_url + 'delfile';
	const param = {
		'productid': spaceid,
		'delfile_name': file_str
	};
	try {
		const res: any = await post(url, JSON.stringify(param));
		const data = res.responseText as string;
		const data_1 = JSON.parse(data);
		if (data_1 && data_1.code == 1) {
			return 'success';
		} else {
			return 'fail';
		}
	} catch (error) {
		console.log(error)
	}
}